package com.bolt.report.definition;

import java.io.Serializable;

public enum SortOrder implements Serializable {
    NONE(-1), ASC(0), DESC(1);

    Integer code;

    SortOrder(Integer code) {
        this.code = code;
    }

    public static SortOrder toType(Integer code) {
        for (SortOrder typeEnum : SortOrder.values()) {
            if (typeEnum.code.equals(code)) {
                return typeEnum;
            }
        }
        return SortOrder.NONE;
    }
}